#ifndef Singleton_H
#define Singleton_H
#include <cassert>
template <typename T> class Singleton
{
protected:
	Singleton( void );
	~Singleton( void );
public:
	static T* getSingleton( void )
	{  
		if (!ms_Singleton)
		{
			ms_Singleton = new T;
		}
		assert(ms_Singleton!= 0);
		return ms_Singleton;  
	}
private:
	Singleton& operator=(const Singleton&){return this;}
	Singleton(const Singleton&){}
	static T* ms_Singleton;
};
template <class T> T* Singleton<T>::ms_Singleton=0;
#endif
